package com.ihrm.common.controller;

import com.ihrm.common.entity.Result;
import com.ihrm.common.entity.ResultCode;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小伟
 * @version V1.0
 * @Package com.ihrm.common.controller
 * @date 2020/12/21 23:41
 * @Copyright © 2020-2021 郑州恒星科技有限责任公司
 * 请求失败返回相应数据
 */
@RestController
@RequestMapping("/shiro")
public class ErrorController {
    @RequestMapping("/error")
    public Result errorResult(int code) {
        return code == 1 ? new Result(ResultCode.UNAUTHENTICATED) : new Result(ResultCode.UNAUTHORISE);
    }
}
